-- You can also add or configure plugins by creating files in this `plugins/` folder
-- Here are some examples:

---@type LazySpec
return {
  -- == Examples of Adding Plugins ==

  { "mrjones2014/smart-splits.nvim" },
  -- or use a specific version, or a range of versions using lazy.nvim's version API
  { "mrjones2014/smart-splits.nvim", version = ">=1.0.0" },
  -- to use Kitty multiplexer support, run the post install hook
  { "mrjones2014/smart-splits.nvim", build = "./kitty/install-kittens.bash" },

  "andweeb/presence.nvim",
  {
    "ray-x/lsp_signature.nvim",
    event = "BufRead",
    config = function() require("lsp_signature").setup() end,
  },

  -- == Examples of Overriding Plugins ==

  -- customize alpha options
  {
    "goolord/alpha-nvim",
    opts = function(_, opts)
      -- customize the dashboard header
      opts.section.header.val = {
        -- you can find the asiico art from this website:https://patorjk.com/software/taag/#p=display&v=0&f=ANSI%20Shadow%C2%A0ANSI%E9%98%B4%E5%BD%B1&t=chrisn
        "  ██████╗██╗  ██╗██████╗ ██╗███████╗███╗   ██╗",
        " ██╔════╝██║  ██║██╔══██╗██║██╔════╝████╗  ██║",
        " ██║     ███████║██████╔╝██║███████╗██╔██╗ ██║",
        " ██║     ██╔══██║██╔══██╗██║╚════██║██║╚██╗██║",
        " ╚██████╗██║  ██║██║  ██║██║███████║██║ ╚████║",
        "  ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝╚══════╝╚═╝  ╚═══╝",
        " ",
        "     Plunge into the abyss to be reborn ",
        "defying human nature to ascend the highest peak",
      }
      return opts
    end,
  },

  -- You can disable default plugins as follows:
  { "max397574/better-escape.nvim", enabled = false },

  -- You can also easily customize additional setup of plugins that is outside of the plugin's setup call
  {
    "L3MON4D3/LuaSnip",
    config = function(plugin, opts)
      require "astronvim.plugins.configs.luasnip"(plugin, opts) -- include the default astronvim config that calls the setup call
      -- add more custom luasnip configuration such as filetype extend or custom snippets
      local luasnip = require "luasnip"
      luasnip.filetype_extend("javascript", { "javascriptreact" })
    end,
  },

  {
    "windwp/nvim-autopairs",
    config = function(plugin, opts)
      require "astronvim.plugins.configs.nvim-autopairs"(plugin, opts) -- include the default astronvim config that calls the setup call
      -- add more custom autopairs configuration such as custom rules
      local npairs = require "nvim-autopairs"
      local Rule = require "nvim-autopairs.rule"
      local cond = require "nvim-autopairs.conds"
      npairs.add_rules(
        {
          Rule("$", "$", { "tex", "latex" })
            -- don't add a pair if the next character is %
            :with_pair(cond.not_after_regex "%%")
            -- don't add a pair if  the previous character is xxx
            :with_pair(
              cond.not_before_regex("xxx", 3)
            )
            -- don't move right when repeat character
            :with_move(cond.none())
            -- don't delete if the next character is xx
            :with_del(cond.not_after_regex "xx")
            -- disable adding a newline when you press <cr>
            :with_cr(cond.none()),
        },
        -- disable for .vim files, but it work for another filetypes
        Rule("a", "a", "-vim")
      )
    end,
  },
}
